---
layout: "default"
title: "BooleanType"
description: "Swift documentation for 'BooleanType': A type that represents a Boolean value."
keywords: "BooleanType,protocol,swift,documentation,boolValue"
root: "/v2.0"
---

<div class="intro-declaration"><code class="language-swift">protocol BooleanType</code></div>

<div class="discussion comment">
    <p>A type that represents a Boolean value.</p>

<p>Types that conform to the <code>BooleanType</code> protocol can be used as
the condition in control statements (<code>if</code>, <code>while</code>, C-style <code>for</code>)
and other logical value contexts (e.g., <code>case</code> statement guards).</p>

<p>Only three types provided by Swift, <code>Bool</code>, <code>DarwinBoolean</code>, and <code>ObjCBool</code>,
conform to <code>BooleanType</code>. Expanding this set to include types that
represent more than simple boolean values is discouraged.</p>
</div>

<table class="standard">
<tr>
<th id="inheritance">Inheritance</th>
<td>
<span class="viz"><a href="hierarchy/">View Protocol Hierarchy &rarr;</a></span>
</td>
</tr>



<tr>
<th>Import</th>
<td><code class="language-swift">import Swift</code></td>
</tr>

</table>




<h3>Instance Variables</h3>
<div class="declaration" id="var-boolvalue_-bool">
<a class="toggle-link" data-toggle="collapse" href="#comment-var-boolvalue_-bool">var boolValue: Bool</a> <span class="required">Required</span><div class="comment collapse" id="comment-var-boolvalue_-bool"><div class="p">
    <p>The value of <code>self</code>, expressed as a <code>Bool</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">var boolValue: Bool { get }</code>

    </div></div>
</div>





